The present invention generally relates to a tone generating apparatus and a tone generating method for generating music tones by executing predetermined music generating software on a computer.
A tone generating apparatus is known in which music tones are generated by executing a predetermined music tone generating software on a general-purpose processor such as a CPU (Central Processing Unit). Such an apparatus is called a software sound source. Recently, as higher performance is required of this software sound source, so is higher speeds of music tone processing to meet this requirement.
Recently, CPUs have been proposed that have instructions each capable of executing a plurality of arithmetic operations concurrently. These CPUs include for example a CPU made by Intel Corporation that has an extended instruction set called MMX.
In the conventional parallel processing as applied to graphic processing, adjacent pixels each represented by one byte data (eight bits) are grouped and the processing operations for the plurality of grouped pixels are performed in parallel. When voice processing and tone generating processing are performed in parallel, a plurality of samples (each represented by 16-bit data) that continue one after another in time are grouped, and amplitude control and filter processing are performed on each group.
It is also possible to perform the above-mentioned processing by use of the above-mentioned CPU having an extended instruction set capable of executing a plurality of arithmetic operations by a single instruction in parallel. Referring to FIG. 5, there is shown a block diagram illustrating an algorithm for executing effect processing of a software sound source. Referring to FIG. 6A, there is shown a detailed circuit diagram illustrating an APn circuit of FIG. 5. Referring to FIG. 6B, there is shown a detailed circuit diagram illustrating a CFn circuit of FIG. 5. As shown in FIGS. 6A and 6B, there are sections in which two pieces of input data are multiplied by a predetermined coefficient and the resultant pieces of data are added together. These sections are (m4, m5, and a5) and (m6, m7, and a6) in FIG. 6A and (m9, m10, a7) in FIG. 6B, for example. The arithmetic operations in these sections can be executed with a single instruction if a CPU is used having an extended instruction set capable of multiplying two pieces of input data by a predetermined coefficient and adding the resultant data together, thereby realizing high-speed processing. Actually, however, such high-speed processing is only realized by well contriving computational operations in one processing algorithm. This inevitably leaves portions that cannot be completely processed in parallel, preventing the advantages of parallel processing from being fully used.
The processing of generating music tone waveforms includes processing for obtaining a current waveform sample from a past waveform sample during the course of address generation, envelope generation, and filtering. To be more specific, in address generation, a current address is obtained based on an address one sampling period before. In envelope generation, a current envelope value is obtained based on an immediately preceding envelope value. In filtering, a filter computation is performed based on values of a past waveform sample and a current input waveform sample to generate and output an output waveform sample. Thus, obtaining a current waveform sample from a past waveform sample makes it difficult to process in parallel the waveform samples adjacent to each other in terms of time.
A tone generating apparatus is known in which music tones are generated by executing a predetermined music tone generating software on a general-purpose processor such as a CPU. Such an apparatus is called a software sound source. Some software sound sources also use a software effector to provide effects such as reverberation on a generated music tone and output the effect-added tone. Recently, it is required to enhance the performance of software sound sources to provide a variety of effects.
A software sound source is provided with a buffer area for waveform generation to generate a plurality of samples collectively when synthesizing a music tone by software. FIG. 9B shows an example of a waveform generating buffer area. As shown in FIG. 9B, reference numerals 1, 2, . . . , 128 denote storage areas for 128 sets of waveform samples which are time-series data sequentially arranged in terms of time. One set of waveform sample storage area is composed of DryL, DryR, and Rev. DryL denotes a storage area for a waveform sample to which reverberation of the stereophonic left side is not attached. DryR denotes a storage area for a waveform sample to which reverberation of the stereophonic right side is not attached. Rev denotes a storage area for a waveform sample to which reverberation is attached. Namely, the waveform samples are held in an interleaved form with a combination of DryL, DryR, and Rev as one unit. This is because it is convenient for these effects to align the buffer in this order when writing output data of each channel in waveform computation.
For example, a software sound source generates waveform samples for one frame (128 samples) of all channels through which a music tone is generated for each frame, which is a predetermined time interval. The software sound source accumulates the generated waveform samples in a waveform generating buffer shown in FIG. 9B, and outputs waveform data. First, 128 samples of the first channel are generated and the generated samples are weighted such that values of DryL, DryR, and Rev of each sample are respectively multiplied with predetermined coefficients. The weighted samples are stored in the waveform generating buffer of FIG. 9B. Next, 128 samples of the second channel are generated, the generated samples are weighted, and the weighted samples are accumulated in the waveform generating buffer of FIG. 9B. Then, 128 samples of the third channel are generated, the generated samples are weighted, and the weighted samples are accumulated in the waveform generating buffer of FIG. 9B. These operations are repeated for all channels to vocalize musical tones. The generated waveform data is passed to a sound I/O device (an LSI called CODEC for executing input/output operations of music tone waveform data) by a DMAC (Direct Memory Access Controller) instructed so by the system. The sound I/O device performs digital-to-analog conversion on the received waveform data and vocalizes the converted data through a sound system.
The software sound source is required to provide a variety of effects. A problem is, however, that the sequence of computations (or the connecting relationship between effectors) for providing a plurality of effects cannot be altered dynamically.
Some processors used for the software sound source have an internal or external cache memory. However, a data structure of the waveform generating buffer as shown in FIG. 9B easily causes cache miss at waveform generation, especially, at computation by software effector. For example, in the example of FIG. 9B, the software effector for calculating reverberation performs computation by taking Rev of 128 samples intermittently stored in an interleaved manner, often resulting in cache miss. When the effect attached is reverberation alone, not so much overhead is caused. As the number of effects attached increases, however, the chance of cache miss especially increases. For example, if three types of effects (reverberation, chorus, and variation) are attached and there are seven output systems, the data structure of FIG. 9B is extended to DryL, DryR, Rev, ChorusL, ChorusR, VariationL, and VariationR, which are handled as one unit arranged for 128 samples in the waveform generating buffer. In this case, the effector executes computational processing in the following sequence:
(1) Computation for variation is executed by collecting VariationL and VariationR for 128 samples; PA1 (2) Computation for chorus is executed by collecting ChorusL and ChorusR for 128 samples; and PA1 (3) Computation for reverberation is executed by collecting Rev for 128 samples.
Therefore, access must be frequently made to the data areas arranged intermittently in the waveform generating buffer, thereby increasing the chance of cache miss, and seriously lowering processing efficiency.
A conventional music apparatus is generally composed of a MIDI (Musical Instrument Digital Interface), a performance message section in which performance information is inputted from a keyboard or a sequencer, a sound source for generating music tone waveforms, and a central processing unit (CPU) for controlling the sound source according to the inputted performance information. The CPU executes sound source driver processing such as channel assignment and parameter conversion according to the inputted performance information. In addition, the CPU supplies a converted parameter and a sounding start command (note-on command) to an assigned channel in the sound source. The sound source generates music tone waveforms based on the supplied parameters. For the sound source, hardware such as an electronic circuit is used. The above-mentioned conventional setup inevitably makes the music tone generator dedicated to the music tone generation. Consequently, the generation of music tones requires to prepare a dedicated music tone generator. In generating music tones by a general-purpose processor such as a personal computer, a dedicated sound source is attached externally. Alternatively, an extended board having several IC chips such as a music tone generating chip for generating music tone waveforms, a waveform ROM for storing waveform data, and a coder/decoder (CODEC) composed of an A/D converter, a D/A converter, a FIFO buffer, and an interface circuit is connected to the personal computer for music tone generation.
Recently, a music tone generating module or a so-called software sound source has been proposed in which the operations of the above-mentioned hardware sound source are replaced by sound source processing based on a computer program and performance processing, and the sound source processing are executed by the CPU. The performance processing herein denotes processing equivalent to the above-mentioned sound source driver processing in which, based on the inputted information such as MIDI data, control information for controlling music tones is generated. The sound source processing herein denotes processing in which, based on the control information generated by the performance processing, music tone waveforms are synthesizes. According to this music tone generating module, only providing a D/A converting chip in addition to the CPU and software enables music tone generation without using a dedicated hardware music tone generator and a sound source board.
The software sound sources as mentioned above are classified into various types according to a method of simulating an acoustic musical instrument; for example, PCM sound sourcing, FM sound source, and physical model sound source. To synthesize music tones in any type of these sound sources, it is required to separately prepare a sound source processing program corresponding to each type. This gives rise to a problem of significantly increasing the storage capacity for storing the sound source processing programs and waveform data necessary for sound processing.
Another problem is that, since there is no standard data format for these sound sources, it is impossible to synthesize music tones by an algorithm in which the different sound sources such as mentioned above are integrated with each other.